package com.haixiaoke.saas.workOrder.state.server;

import com.haixiaoke.saas.workOrder.domain.WorkOrderPerson;
import com.haixiaoke.saas.workOrder.domain.WorkOrder;
import com.haixiaoke.saas.workOrder.domain.WorkOrderRecord;

/**
 * 特定工单类型服务方-接口
 *
 * @Author panda
 * @Date 2024/9/3
 **/
public interface ISpecificWorkOrderTypeServerRole {

    /**
     * 新增工单
     * @param workOrder
     * @return
     */
    int insertWorkOrder(WorkOrder workOrder, String phone);

    /**
     * 驳回工单、作废工单
     *
     * @param workOrder
     * @param userName        企业端操作人用户名
     * @param flatUserName    C端操作人用户名
     * @return
     */
    int rejectWorkOrder(WorkOrder workOrder, WorkOrderRecord workOrderRecord, String userName, String flatUserName);

    /**
     * 派单、改派工单
     *
     * @param workOrder   工单
     * @param workOrderPerson 维修员
     * @return
     */
    int dispatchWorkOrder(WorkOrder workOrder, WorkOrderPerson workOrderPerson);

    /**
     * 接单
     *
     * @param workOrder         工单
     * @param workOrderRecord   跟进记录
     * @param busUserId         维修员id
     * @param personTenantId    工单员的租户id
     * @return
     */
    int receivedWorkOrder(WorkOrder workOrder, WorkOrderRecord workOrderRecord, Long busUserId, String personTenantId);

    /**
     * 支付完成
     *
     * @param workOrder
     * @param record
     * @return
     */
    int paymentCompletion(WorkOrder workOrder, WorkOrderRecord record);

    /**
     * 申请拒接
     *
     * @param workOrder           工单
     * @param workOrderRecord     工单跟进记录
     * @param busUserId           维修员id
     * @param personTenantId      工单员的租户id
     * @return
     */
    int requestRejectionWorkOrder(WorkOrder workOrder, WorkOrderRecord workOrderRecord, Long busUserId, String personTenantId);

    /**
     * 审核拒接
     * @param workOrder           工单
     * @param workOrderRecord     工单跟进记录
     * @param username            操作人用户名
     * @return
     */
    int auditDenialWorkOrder(WorkOrder workOrder, WorkOrderRecord workOrderRecord, String username);

    /**
     * 编辑已接单、处理中工单
     * @param workOrder
     * @return
     */
    int beingRepaired(WorkOrder workOrder);

    /**
     * 提交缴费单
     * @param workOrder
     * @return
     */
    int submitPaymentSlip(WorkOrder workOrder);

    /**
     * 工单人员撤销拒接申请
     * @param workOrderRecord       工单跟进记录
     * @param busUserId             维修员id
     * @param personTenantId        工单员的租户id
     * @return
     */
    int revocationRejectionWorkOrder(WorkOrder workOrder, WorkOrderRecord workOrderRecord, Long busUserId, String personTenantId);

    /**
     * 申请临时密码
     * @param workOrder
     */
    void applyTemporaryPassword(WorkOrder workOrder,String name,String phone,Long busUserId);

    /**
     * 更新工单
     * @param workOrder
     * @param phone
     * @return
     */
    int updateWorkOrder(WorkOrder workOrder, String phone);

    /**
     * 确认已看房
     * @param busUserId       工单人员id
     * @param personTenantId  工单人员租户id
     * @return
     */
    int confirmLookHouse(WorkOrder workOrder, Long busUserId, String personTenantId);
}
